package com.hmall.cart.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 使用restTemplate远程调用配置
 *
 * @Author katana
 * @Date 2025/6/17 14:53
 */
@Configuration
public class RemoteCallConfig {
    
    /**
     * 配置远程调用实例,loadBalanced开启负载均衡
     *
     * @return restTemplate
     */
    @Bean
    @LoadBalanced
    public RestTemplate remoteCallService() {
        return new RestTemplate();
    }
}
